# 提供给其它插件项目引用的共享资源(如果其它插件想通过框架构建引用的话）
if(FRAMEWORK_WANT_INCLUDE)

    message("-- [PLUGIN EXPORT]: FRAMEWORK_WANT_INCLUDE?")

    # version
    if(feature_version)
        set(_template_file version.h)
        string(TIMESTAMP BUILD_DATE "%Y%m%d")
        string(TIMESTAMP BUILD_TIME "%H%M%S")
        configure_file(
            ${CMAKE_CURRENT_LIST_DIR}/templates/${_template_file}.in
            ${CMAKE_CURRENT_BINARY_DIR}/templates/${_template_file}
            @ONLY)
        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录 - 用于 include
            ${CMAKE_CURRENT_BINARY_DIR}/templates
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件 - 用于 构建
            ${CMAKE_CURRENT_BINARY_DIR}/templates/${_template_file}
        )
        unset(_template_file)
    endif(feature_version)

    # baseutil
    if(feature_baseutil)
        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录 - 用于 include
            ${CMAKE_CURRENT_LIST_DIR}/utils/baseutil
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件 - 用于 构建
            ${CMAKE_CURRENT_LIST_DIR}/utils/baseutil/*
        )
    endif(feature_baseutil)

    # qrcutil
    if(feature_qrcutil)
        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录 - 用于 include
            ${CMAKE_CURRENT_LIST_DIR}/utils/qrcutil
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件 - 用于 构建
            ${CMAKE_CURRENT_LIST_DIR}/utils/qrcutil/*
        )
    endif(feature_qrcutil)

    # screenutil
    if(feature_screenutil)
        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录 - 用于 include
            ${CMAKE_CURRENT_LIST_DIR}/utils/screenutil
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件 - 用于 构建
            ${CMAKE_CURRENT_LIST_DIR}/utils/screenutil/*
        )
    endif(feature_screenutil)

    # dbusutil
    if(feature_dbusutil)
        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录 - 用于 include
            ${CMAKE_CURRENT_LIST_DIR}/utils/dbusutil
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件 - 用于 构建
            ${CMAKE_CURRENT_LIST_DIR}/utils/dbusutil/*
        )
        find_package(Qt${QT_VERSION_MAJOR}DBus)
        target_link_libraries(${FRAMEWORK_PLUGIN} Qt${QT_VERSION_MAJOR}::DBus)
    endif(feature_dbusutil)

    # defer
    if(feature_defer)
        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录 - 用于 include
            ${CMAKE_CURRENT_LIST_DIR}/utils/defer
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件 - 用于 构建
            ${CMAKE_CURRENT_LIST_DIR}/utils/defer/*
        )
    endif(feature_defer)

    # qd
    if(feature_qd)
        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录 - 用于 include
            ${CMAKE_CURRENT_LIST_DIR}/include
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件 - 用于 构建
            ${CMAKE_CURRENT_LIST_DIR}/include/qd.h
        )
    endif(feature_qd)

    # quazip
    if(feature_quazip)
        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录 - 用于 include
            ${CMAKE_CURRENT_LIST_DIR}/libs
            ${CMAKE_CURRENT_LIST_DIR}/libs/quazip
            ${CMAKE_CURRENT_LIST_DIR}/libs/zlib
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件 - 用于 构建
            ${CMAKE_CURRENT_LIST_DIR}/libs/quazip/*
            ${CMAKE_CURRENT_LIST_DIR}/libs/zlib/*
        )
        target_compile_definitions(${FRAMEWORK_PLUGIN} PRIVATE QUAZIP_BUILD QT_DEPRECATED_WARNINGS)
    endif(feature_quazip)

    # qxtjson
    if(feature_qxtjson)
        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录 - 用于 include
            ${CMAKE_CURRENT_LIST_DIR}/libs/
            ${CMAKE_CURRENT_LIST_DIR}/libs/qxtjson
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件 - 用于 构建
            ${CMAKE_CURRENT_LIST_DIR}/libs/qxtjson/*
        )
    endif(feature_qxtjson)

    # log4qt
    if(feature_log4qt)
        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录 - 用于 include
            ${CMAKE_CURRENT_LIST_DIR}/libs/
            ${CMAKE_CURRENT_LIST_DIR}/libs/log4qt
            ${CMAKE_CURRENT_LIST_DIR}/libs/log4qt/helpers
            ${CMAKE_CURRENT_LIST_DIR}/libs/log4qt/spi
            ${CMAKE_CURRENT_LIST_DIR}/libs/log4qt/varia
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件 - 用于 构建
            ${CMAKE_CURRENT_LIST_DIR}/libs/log4qt/*
            ${CMAKE_CURRENT_LIST_DIR}/libs/log4qt/helpers/*
            ${CMAKE_CURRENT_LIST_DIR}/libs/log4qt/spi/*
            ${CMAKE_CURRENT_LIST_DIR}/libs/log4qt/varia/*
        )
    endif(feature_log4qt)

    # quickevent
    if(feature_quickevent)
        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录 - 用于 include
            ${CMAKE_CURRENT_LIST_DIR}/libs/
            ${CMAKE_CURRENT_LIST_DIR}/libs/quickevent
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件 - 用于 构建
            ${CMAKE_CURRENT_LIST_DIR}/libs/quickevent/*.h
            ${CMAKE_CURRENT_LIST_DIR}/libs/quickevent/*.cpp
        )
        set(quickevent_VERSION 3.0.1)
        set(quickevent_VERSION_MAJOR 3)
        set(quickevent_VERSION_MINOR 0)
        set(quickevent_VERSION_PATCH 1)
        configure_file(
            "${CMAKE_CURRENT_LIST_DIR}/libs/quickevent/QuickEventConfig.h.in"
            "${CMAKE_CURRENT_BINARY_DIR}/quickconfig.h"
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS
            ${CMAKE_CURRENT_BINARY_DIR}/quickconfig.h
        )
    endif(feature_quickevent)

    # eaters
    if(feature_eaters)
        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录 - 用于 include
            ${CMAKE_CURRENT_LIST_DIR}/utils/eaters
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件 - 用于 构建
            ${CMAKE_CURRENT_LIST_DIR}/utils/eaters/*
        )
    endif(feature_eaters)

    # analyzer
    if(feature_analyzer)
        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录 - 用于 include
            ${CMAKE_CURRENT_LIST_DIR}/utils/analyzer
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件 - 用于 构建
            ${CMAKE_CURRENT_LIST_DIR}/utils/analyzer/*
        )
        target_compile_definitions(${FRAMEWORK_PLUGIN} PRIVATE SPARK_FEATURE_ANALYZER)
    endif(feature_analyzer)

    set(FRAMEWORK_WITHGIT_EXPORTS      # 共享的引用构建资源
        # 1. 引用了公共存储库
        # https://gitee.com/ndd-community/framework-plugin-component-library

        # 2. 还需要用到 QFtp 库，因为此项目没有提供
        # https://gitee.com/spark-framework-libs/QFtp

        # 3. 用到 QFtp 公共库
        # https://gitee.com/spark-framework-libs/spark-framework-test-qftp
    )

    # 特殊构建 - 为引用资源的目标配置预期所需依赖的构建
        # FRAMEWORK_PLUGIN 引用本资源的框架目标变量
    # find_package(Qt5Network)
    # target_link_libraries(${FRAMEWORK_PLUGIN} Qt5::Network)

    return()
endif(FRAMEWORK_WANT_INCLUDE)
